var t = getApp();

Page({
    data: {
        show: !0,
        order_type: "",
        last_page: "",
        current_page: 1,
        listData: [],
        httpUrl: "",
        id: ""
    },
    onLoad: function(t) {
        var a = t.order_type;
        a && (this.setData({
            order_type: a
        }), "lawyer" == a ? this.setData({
            httpUrl: "plugin.lawyer-platform.frontend.controllers.order.lawyerOrder"
        }) : "member" == a ? this.setData({
            httpUrl: "plugin.lawyer-platform.frontend.controllers.order.selfOrder"
        }) : "office" == a && this.setData({
            httpUrl: "plugin.lawyer-platform.frontend.controllers.order.lawyerFirmOrder"
        })), this.getdata();
    },
    getdata: function() {
        var a = this;
        t._postNetWork({
            url: t.getNetAddresss(this.data.httpUrl),
            success: function(e) {
                1 == e.data.result ? (e.data.data.list.data.forEach(function(t) {
                    t.flag = !1;
                }), a.setData({
                    listData: e.data.data.list.data,
                    last_page: e.data.data.list.last_page
                })) : t.tips(e.data.msg);
            }
        });
    },
    goodDetail: function(t) {
        var a = t.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/packageA/detail_v2/detail_v2?id=" + a
        });
    },
    link: function(t) {
        wx.navigateTo({
            url: "/packageI/lawyerPlatform/detail/detail?type_name=lawyer&id=" + t.currentTarget.dataset.id
        });
    },
    tel: function(t) {
        var a = t.currentTarget.dataset.mobile, e = t.currentTarget.dataset.type, r = t.currentTarget.dataset.info;
        "tel" == e ? wx.makePhoneCall({
            phoneNumber: a
        }) : wx.navigateTo({
            url: "/packageH/chitchat/chatWindow/chatWindow?chatType=1&message_type=1&employeeId=" + r.lawyer.employee_id + "&plugin_name=lawyer&user_id=" + r.member_id
        });
    },
    buttonSwitch: function(t) {
        var a = t.currentTarget.dataset.id;
        this.data.id == a ? this.setData({
            id: ""
        }) : this.setData({
            id: a
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        var a = this;
        if (this.data.current_page < this.data.last_page) {
            var e = t.getNetAddresss(this.data.httpUrl), r = this.data.page + 1;
            t._postNetWork({
                url: e,
                data: {
                    page: r
                },
                success: function(t) {
                    1 == t.data.result && (a.data.listData = a.data.listData.concat(t.data.data.list.data), 
                    a.setData({
                        listData: a.data.listData,
                        current_page: t.data.data.list.current_page,
                        last_page: t.data.data.list.last_page
                    }));
                }
            });
        }
    },
    onShareAppMessage: function() {}
});